package com.example.multithread.chapter01;

import lombok.SneakyThrows;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Collections;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * @ClassName Example02
 * @Description TODO
 * @Author leejiliang
 * @DateTime 2020/4/27 2:18 PM
 * @Version 1.0
 */
public class RunnableExample implements Runnable {
	private Logger logger = LoggerFactory.getLogger(RunnableExample.class);
	private AtomicInteger count;

	public RunnableExample(AtomicInteger count) {
		this.count = count;
	}
	@SneakyThrows
	@Override
	public void run() {
		Thread.currentThread().wait(3000);
		count.incrementAndGet();
	}
}
